from selenium import webdriver
from selenium.webdriver.common.by import By

from test_wechat.train_step2.PO.add_member_page import addmember_page
from test_wechat.train_step2.PO.basepage import BasePage
from test_wechat.train_step2.PO.contact_page import contact_page


class mainpage(BasePage):
    driver = webdriver.Chrome()
    url = "https://work.weixin.qq.com/wework_admin/frame"
    def goto_contact(self):
        """
        跳转到通讯录界面
        :return:
        """
        return contact_page(self.driver)
    def goto_add_member(self):
        """
        跳转到添加成员页面
        :return:
        """
        #子类调用父类
        self.driver.find_element_by_xpath('//*[@id="_hmt_click"]/div[1]/div[4]/div[2]/a[1]/div').click()

        return addmember_page(self.driver)